﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/taglab.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<meta http-equiv=Content-Type content="text/html; charset=utf-8" />
		<link href="${pageContext.request.contextPath}/pages/jtext/css/style.css" type="text/css" rel="stylesheet" />
		<title>文本列表</title>
		<script src="${pageContext.request.contextPath}/pages/jtext/js/JtextList.js"></script>
	
	</head>

	<body topMargin="10">
		<div id="append_parent"></div>
		<table cellSpacing=6 cellPadding=2 width="100%" border="0">
			<tbody>
				<tr>
					<td>
						<table class="guide" cellSpacing="0" cellPadding="0" width="100%"
							border="0">
							<tbody>
								<tr>
									<td>
										Memory的CRUD
									</td>
								</tr>
								<tr align="center">
									<center>
										<td class="altbg1" width="70%">
											<input type="text" name="info" value="${info }"/>
											<input type="button" value="搜索" onClick="search()">
										</td>
									</center>
								</tr>
							</tbody>
						</table>
						<br />
							<!--项目列表开始-->
							<table class="tableborder" cellSpacing="0" cellPadding="0"
								width="100%" border="0">
								<tbody>
									<s:if test="%{ jtextList != null && jtextList.size != 0 }">
									<tr class="header">
										<td class="altbg1">
											<b><input type="checkbox" name="allCkeckbox" onClick="clickAllCheckbox('checkbox1')"/></b>
										</td>
										<td class="altbg1">
											<b>编号</B>
										</td>
						
										<td class="altbg1">
											<b>名称</B>
										<td class="altbg1">
											<b>内容</B>
										</td>
										<td class="altbg1">
											<b>修改时间</B>
										</td>
										
									</tr>
								
									<s:iterator value="jtextList" var="n">
										<tr>
											<td class="altbg2">
												<input type="checkbox" name="checkbox1" value="${n.id }" />
											</td>
											<td class="altbg2" width="20%">
												<b><a href="${pageContext.request.contextPath}/jtext/viewJtext?jtext.id=${n.id }">${n.id }</a></b>
											</td>
											<td class="altbg2">
												<b><a href="${pageContext.request.contextPath}/jtext/viewJtext?jtext.id=${n.id }">${fn:substring(n.name , 0 , 30 )}</a></b>
											</td>
											<td class="altbg2">
												<b>${fn:substring(n.content , 0 , 30 )}</b>
											</td>
											<td class="altbg2">
												<b><fmt:formatDate pattern="yyyy-MM-dd" value="${n.updateForHis}" /></b>
											</td>
										</tr>
									</s:iterator>
										<tr>
											<td class="altbg2" colspan="5">
												<center>
													<a href="javascript:gotoPage(${1 })">首页</a>
													&nbsp;|&nbsp;
													<s:if test="%{page.index>1}">
														<a href="javascript:gotoPage(${page.index-1 })">上一页</a>
													</s:if>
													<s:else>
														上一页
													</s:else>
													&nbsp;|&nbsp;
													当前第${page.index }页&nbsp;|&nbsp;共${page.totalPage }页
													&nbsp;|&nbsp;
													<s:if test="%{page.index < page.totalPage}">
														<a href="javascript:gotoPage(${page.index+1 })">下一页</a>
													</s:if>
													<s:else>
														下一页
													</s:else>
													&nbsp;|&nbsp;
													<a href="javascript:gotoPage(${page.totalPage })">尾页</a>
												</center>
											</td>
										</tr>
			  						</s:if>
			  						<s:else>
							  		<tr>
							  			<td colspan="5">无数据</td>
							  		</tr>
							  		</s:else>
								</tbody>
							</table>
							<!--项目列表结束-->
							<br />
							<center>
								<input class="button" type="button" value="删除文本" onClick="deleteRecord('checkbox1')"/>
								<input class="button" type="button" value="新建文本"  onclick="window.location.href='${pageContext.request.contextPath}/jtext/prepareAddJtext'"/>
								<input class="button" type="button" value="编辑文本"  onclick="editRecord('checkbox1')"/>
								
							</center>
					</td>
				</tr>
			</tbody>
		</table>

	</body>
</html>
